package com.cskaoyan.config;

import com.cskaoyan.bean.User;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author stone
 * @date 2022/10/08 14:49
 */
@ComponentScan("com.cskaoyan.controller")
@EnableWebMvc
public class WebConfiguration implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // mapping location
        registry.addResourceHandler("/pic1/**").addResourceLocations("classpath:/");
        registry.addResourceHandler("/pic2/**").addResourceLocations("/");
        registry.addResourceHandler("/pic3/**").addResourceLocations("file:D:\\spring/");
        // com.cskaoyan.config.WebConfiguration
        // org.springframework.web.servlet.DispatcherServlet
        // org.springframework.web.servlet.DispatcherServlet
        /*String name = "songge";
        //String username = "songge";
        boolean equals = "songge".equals(name);
        if (equals) {
            User user3 = new User();
            User user3 = new User();
            User user3 = new User();

        }*/
    }
}
